<?php
define("HOST_SQL","localhost");
define("USER_SQL","root");
define("PASS_SQL","");
define("DB_NAME_SQL","matricula");
header("Content-Type: text/html; charset=UTF-8", true);  

class DbSingleton
{
    // Guarda uma instância da classe
    private static $instance;
    


    // O método singleton 
    public static function getConexao()
    {
        if (!isset(self::$instance)) {
            self::$instance = new mysqli(HOST_SQL,USER_SQL, PASS_SQL,DB_NAME_SQL);;
        }
            if (mysqli_connect_errno()) trigger_error(mysqli_connect_error());
        return self::$instance;
    }
    

}
?>